package top.zlcode.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ResultCode {

    /** 基本状态码 **/
    SUCCESS                 (1000, "操作成功"),
    ERROR                   (2000, "服务器繁忙, 请稍后重试"),

    FAILED                  (3000, "操作失败"),
    FAILED_UNAUTHORIZED     (3001, "未授权"),
    FAILED_PARAMS_VALIDATE  (3002, "参数校验失败"),
    FAILED_NOT_EXISTS       (3003, "资源不存在"),
    FAILED_ALREADY_EXISTS   (3004, "资源已存在"),

    /** 用户相关 **/
    AILED_USER_EXISTS       (3101, "用户已存在"),
    FAILED_USER_NOT_EXISTS  (3102, "用户不存在"),
    FAILED_LOGIN            (3103, "用户名或密码错误"),
    FAILED_USER_BANNED      (3104, "你已被列入黑名单, 请联系管理员"),
    FAILED_USER_EMAIL       (3105, "输入的邮箱有误"),
    FAILED_FREQUENT         (3106, "操作频繁, 请稍后重试"),
    FAILED_COUNT_LIMIT      (3107, "当天请求次数已达上限"),
    FAILED_SEND_CODE        (3108, "验证码发送失败"),
    FAILED_INVALID_CODE     (3109, "验证码无效"),
    FAILED_ERROR_CODE       (3109, "验证码错误"),


    /** 竞赛相关 **/
    EXAM_START_TIME_BEFORE_CURRENT_TIME   (3201, "竞赛开始时间不能早于当前时间"),
    EXAM_START_TIME_AFTER_END_TIME        (3202, "竞赛时间不能晚于竞赛结束时间"),
    EXAM_NOT_EXISTS                       (3203, "竞赛不存在"),
    EXAM_ALREADY_EXISTS                   (3204, "竞赛已存在"),
    EXAM_QUESTION_NOT_EXISTS              (3205, "为竞赛新增的题目不存在"),
    EXAM_STARTED                          (3206, "竞赛已经开始, 无法进行操作"),
    EXAM_NOT_HAS_QUESTION                 (3207, "竞赛当中不包含题目"),
    EXAM_FINISHED                         (3208, "竞赛已经结束, 无法进行结束"),
    EXAM_HAS_ENTER                        (3208, "竞赛已经被你报名, 无需重新报名"),

    /** 题目相关 **/
    QUESTION_FAILED_FIRST_QUESTION        (3501, "当前题目已经是第一题了哦"),
    QUESTION_FAILED_LAST_QUESTION         (3502, "当前题目已经是最后一题了哦"),
    QUESTION_NOT_EXISTS                   (3503, "当前题目不存在"),
    QUESTION_NOT_SUPPORT_PROGRAM          (3504, "当前不支持此语言"),
    QUESTION_SUBMIT_NOT_EXISTS            (3505, "该提交记录不存在"),
    QUESTION_CODE_SUGGEST_NOT_PASS        (3506, "当前记录代码未通过, 无法进行代码建议优化"),

    /**
     * RabbitMQ 相关异常
     */
    RABBITMQ_FAILED_PRODUCE               (3601, "RabbitMQ 生产消息异常"),

    /** AI 相关 */
    AI_CHAT_FAILED                        (3701, "服务器繁忙, 请稍后再使用 AI 功能哦!"),

    /** 文件相关 **/
    FILE_CREATE_FAILED                    (3801, "文件创建失败"),
    FILE_NAME_ERROR                       (3802, "文件名不能包含 @ 符号"),
    FILE_DELETE_ERROR                     (3803, "删除图片失败");

    private final int code;
    private final String msg;
}
